﻿using Modules.Attachment;
using System.ComponentModel.DataAnnotations;

namespace ManagementApi.Models.Person
{
    public class PersonCertificateForm
    {

        public string? Id { get; set; }
        /// <summary>
        /// 证书类型（证书字典表顶级） 
        ///</summary>
        [Display(Name = "证书类型")]
        [Required(ErrorMessage = "{0}不能为空")]
        public byte CertificateType { get; set; }
        /// <summary>
        /// 技能分类、执业注册类型 
        ///</summary>
        public string? SkillClassification { get; set; }
        /// <summary>
        /// 技能类别 
        ///</summary>
        public string? SkillCategory { get; set; }
        /// <summary>
        /// 技能等级、资格名称、职称等级 
        ///</summary>
        public string? SkillLevel { get; set; }
        /// <summary>
        /// 证书编号、注册证书编号、批准文号 
        ///</summary>
        public string? CertificateNo { get; set; }
        /// <summary>
        /// 发证日期、批准日期 
        ///</summary>
        public DateTime? IssueDate { get; set; }
        /// <summary>
        /// 发证机关、审批机关 
        ///</summary>
        public string? IssuingAuthority { get; set; }
        /// <summary>
        /// 持有人 
        ///</summary>
        public string? Holder { get; set; }
        /// <summary>
        /// 执业印章号 
        ///</summary>
        public string? PracticingSealNumber { get; set; }
        /// <summary>
        /// 注册有效期、有效期至 
        ///</summary>
        public DateTime? RegisterEndDate { get; set; }
        /// <summary>
        /// 资质证书状态 
        ///</summary>
        public string? Status { get; set; }
        /// <summary>
        /// 岗位证书专业、专业名称 
        ///</summary>
        public string? CertificateSpeciality { get; set; }
        /// <summary>
        /// 证书名称 
        ///</summary>
        public string? Name { get; set; }
        /// <summary>
        /// 评审组织 
        ///</summary>
        public string? ReviewOrganization { get; set; }

        /// <summary>
        /// 证书附件
        /// </summary>
        [Display(Name = "证书附件")]
        public IEnumerable<AttachmentsForm<string>>? Attachments { get; set; }

        /// <summary>
        /// 专业集合（只针对执业注册证书）
        /// </summary>
        public IEnumerable<PersonCertificateSpecialityForm>? Speciality { get; set; }
    }

    /// <summary>
    /// 证书专业模型
    /// </summary>
    public class PersonCertificateSpecialityForm
    {
        /// <summary>
        /// 注册专业编号 
        ///</summary>
        public string Code { get; set; }
        /// <summary>
        /// 注册专业名称 
        ///</summary>
        public string SpecialityName { get; set; }
        /// <summary>
        /// 注册专业起始日期 
        ///</summary>
        public DateTime? StartDate { get; set; }
        /// <summary>
        /// 注册专业截至日期 
        ///</summary>
        public DateTime? EndDate { get; set; }
    }
}
